import request from "@/utils/request";
// 消息列表
export const messageList = (params) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: "/message/message",
    method: "get",
    params,
  });
// 消息新增
export const messageAdd = (data) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: "/message/message",
    method: "post",
    data,
  });
// 消息编辑
export const messageEdit = (data) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: `/message/message/${data.id}`,
    method: "PUT",
    data,
  });
// 消息撤回
export const messageRecall = (data) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: `/message/message/recall`,
    method: "post",
    data,
  });
// 删除消息
export const messageDelete = (params) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: `/message/message/${params.id}`,
    method: "delete",
  });

//option
export const dictionary = (params) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: "/message/dictionary/match",
    method: "get",
    params,
  });

//详情
export const messageDetails = (params) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url: `/message/message/${params.id}`,
    method: "get",
  });
//文件上传
export const uploadFile = (data, url) =>
  request({
    baseURL: window.APP_GETEWAY.message,
    url,
    method: "post",
    data,
    headers: {
      repeatSubmit: true
    },
  });

